﻿@model WebStore.Web.App.Models.Cart.OrderModel
<h2>@Model.User Order:</h2>
<table width="90%" align="center">
    <thead>
        <tr>
            <th align="center">Quantity</th>
            <th align="left">Item</th>
            <th align="right">Price</th>
            <th align="right">Subtotal</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var order in Model.Products)
        {
            <tr>
                <td align="center">@order.Quantity</td>
                <td align="left">@order.Name</td>
                <td align="right">@order.Price.ToString("c")</td>
                <td align="right">@((order.Quantity * order.Price).ToString("c"))</td>
            </tr>
        }
    </tbody>
    <tfoot>
        <tr>
            <td colspan="3" align="right">Total:</td>
            <td align="right">
                @Model.TotalValue.ToString("c")
            </td>
        </tr>
    </tfoot>
</table>
@if (Model.RealizedBy == null)
{
    <p align="center" class="actionButtons">
        @Html.ActionLink("Realize", "RealizeOrder", "Admin", new { id = Model.Id }, null)
        @Html.ActionLink("Reject", "RejectOrder", "Admin", new { id = Model.Id }, null)
    </p>
}